@extends('layouts.default') @section('main')
    <script type="text/javascript" src="{{URL::asset('js/')}}/common.js"></script>
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
                            class="icon-home"></i> 首页</a>
                <a href="{{url('roadshowapply/index')}}" class="tip-bottom">路演申请管理</a>
                <a href="#" class="current">路演申请审核</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span7">
                    <div class="widget-box">
                        <div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
                            <h5>路演申请审核</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form action="{{url('roadshowapply/edit')}}" id="adForm" method="post" class="form-horizontal">
                                <div class="control-group">
                                    <label class="control-label">ID :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="id" value="{{$list->id}}" readonly="readonly"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">所属空间 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="realName" value="{{$list->name}}" readonly="readonly"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">申请用户 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="realName" value="{{$list->nickname}}" readonly="readonly"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">发起类型 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="intro" value="@if($list->initiator == 'maker')创客空间@elseif($list->initiator == 'project')项目方@endif" readonly="readonly" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label"><span class="redD">*</span>请选择是否审核通过 :</label>
                                    <div class="controls">
                                        <select  name="status" class="span11" >
                                            <option >请选择</option>
                                            <option value="1" @if($list->status==1)selected="selected" @endif>审核通过</option>
                                            <option value="-1" @if($list->status==-1)selected="selected" @endif >审核不通过</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="control-group" id="reason"  @if($list->status!=-1) style="display: none" @endif>
                                    <label class="control-label">拒绝理由 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="reason"  @if($list->reason) value="{{$list->reason}}" @else value="项目不符合近几期无界路演所规定的路演标准" @endif />
                                    </div>
                                </div>

                                <input type="hidden" class="span11" name="formType" value="edit" />
                                <div class="form-actions">
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <button type="button" id="doSave" class="btn btn-success">确认审核</button>
                                </div>
                            </form>
                            @include('errors.list')
                            @include('message.flash')
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        $("#doSave").click(function(){
            ajaxRequest($('#adForm').serializeArray(),$('#adForm').attr('action'),function(data){
                if(data.status){
                    alert(data.message);
                    window.location.href = data.forwardUrl;
                }else{
                    alert(data.message);
                }
            });
        });

        $("select[name=status]").change(function(){
            var status = $(this).val();

            if(status==-1){
                $("#reason").show();
            }else{
                $("#reason").hide();
            }

        })

    </script>
@stop
